package com.aynu.recursion;

import java.io.BufferedReader;
import java.util.Collection;

/**
 * @author mj
 * @version 1.0
 * @date 2020/12/16 23:19
 */
public class RecursionTest {
    public static void main(String[] args) {
        int jieCheng = new RecursionTest().jieCheng(4);
        System.out.println(jieCheng);
        System.out.println(5>>2);
        System.out.println(1>>>2);
    }

    public void test(int n) {
        if (n > 2) {
            test(n - 1);
        } else {
            System.out.println("n:" + n);
        }
    }

    //阶乘
    public int jieCheng(int n) {
        if (n == 1) {
            return 1;
        }
        return jieCheng(n - 1) * n;
    }
}
